package com.aaa.service;


import com.aaa.dao.TuserMapper;
import com.aaa.entity.User;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


@Service
public class TuserServiceImpl implements TuserService{

    @Resource
    private TuserMapper tuserMapper;



    @Override
    public boolean addUser(User user) {

        int insert = tuserMapper.insert(user);

        return insert>0?true:false;
    }

/*    @Override
    public boolean delUser(User user) {

        int insert = tuserMapper.delete(user);

        return insert>0?true:false;
    }*/

    @Override
    public boolean delUser(Integer i) {
        int insert = tuserMapper.deleteByPrimaryKey(i);
        return insert>0?true:false;

    }

    @Override
    public boolean updateByPrimaryKeySelective(User user) {
        int insert = tuserMapper.updateByPrimaryKeySelective(user);
        return insert>0?true:false;

    }

    @Override
    public boolean selectByPrimaryKey(Integer id) {
        User insert = tuserMapper.selectByPrimaryKey(id);
        return false;

    }

    @Override
    public List<User> selectAll() {

        List<User> i =tuserMapper.selectAll();
        System.out.println("selectAll"+i);
        return i;
    }

/*
    @Override
    public boolean selectByPrimaryKey(Integer id) {
        int insert = tuserMapper.selectByPrimaryKey(id);
        return insert>0?true:false;
    }
*/


}
